﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MedicalLog.Domain.Entities.Patient>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	UpdatePatient
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="header">
        <h2>Editar un paciente</h2>
    </div>

    <div class="main">
        <% using (Html.BeginForm()) {%>
            <%: Html.ValidationSummary(true) %>
        
            <fieldset class="main-style">
                <table>
                    <tr>
                        <td class="editor-label">
                            Nombre :
                        </td>
                        <td class="editor-field">
                            <%: Html.TextBoxFor(model => model.Name) %>
                            <%: Html.ValidationMessageFor(model => model.Name) %>
                        </td>
                    </tr>
                    <tr>
                        <td class="editor-label">
                            Apellido :
                        </td>
                        <td class="editor-field">
                            <%: Html.TextBoxFor(model => model.LastName) %>
                            <%: Html.ValidationMessageFor(model => model.LastName) %>
                        </td>
                    </tr>
                    <tr>
                        <td class="editor-label">
                            Tel&eacute;fono :
                        </td>
                        <td class="editor-field">
                            <%: Html.TextBoxFor(model => model.Telephone) %>
                            <%: Html.ValidationMessageFor(model => model.Telephone) %>
                        </td>
                    </tr>
                    <tr>
                        <td class="editor-label">
                            Celular :
                        </td>
                        <td class="editor-field">
                            <%: Html.TextBoxFor(model => model.Celphone) %>
                            <%: Html.ValidationMessageFor(model => model.Celphone) %>
                        </td>
                    </tr>
                    <tr>
                        <td class="editor-label">
                            Direcci&oacute;n :
                        </td>
                        <td class="editor-field">
                            <%: Html.TextBoxFor(model => model.Address) %>
                            <%: Html.ValidationMessageFor(model => model.Address) %>
                        </td>
                    </tr>
                    <tr>
                        <td class="editor-label">
                            Fecha de Nacimiento :
                        </td>
                        <td class="editor-field">
                            <%: Html.TextBoxFor(model => model.DateofBirth, String.Format("{0:dd/MM/yyyy}", Model.DateofBirth)) %>
                            <%: Html.ValidationMessageFor(model => model.DateofBirth) %>
                        </td>
                    </tr>
                    <tr>
                        <td class="editor-label">
                            C&eacute;dula :
                        </td>
                        <td class="editor-field">
                            <%: Html.TextBoxFor(model => model.IdentificationNumber) %>
                            <%: Html.ValidationMessageFor(model => model.IdentificationNumber) %>
                        </td>
                    </tr>
                    <tr>
                        <td class="editor-label">
                            Sexo :
                        </td>
                        <td class="editor-field">
                            <%: Html.DropDownListFor(model => model.Gender, new[] { 
                                new SelectListItem 
                                { Text ="Masculino", Value = bool.TrueString}, 
                                
                                
                                new SelectListItem 
                                { 
                                    Text ="Femenino", Value = bool.FalseString} 
                                  }) %>
                        <%: Html.ValidationMessageFor(model => model.Gender) %>
                            <%: Html.ValidationMessageFor(model => model.Gender) %>
                        </td>
                    </tr>
                    <tr>
                        <td class="editor-label">
                            Pasaporte :
                        </td>
                        <td class="editor-field">
                            <%: Html.TextBoxFor(model => model.Passport) %>
                            <%: Html.ValidationMessageFor(model => model.Passport) %>
                        </td>
                    </tr>
                </table>
            </fieldset>
    </div>

    <div class="footer">
        <h4>
            Acciones
        </h4>
        <fieldset class="main-style2">
            <p>
                <input type="submit" value="Actualizar Paciente" />
            </p>
            <%: Html.ActionLink("Regresar a la página principal", "SearchPatient") %>
        </fieldset>
    </div>

    <% } %>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="HeaderContent" runat="server">
    <script src="../../Scripts/MicrosoftAjax.js" type="text/javascript"></script>
    <script src="../../Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#DateofBirth').datepicker({
                yearRange: "-80:+0",
                changeMonth: true,
                changeYear: true,
                showOn: "both",
                buttonImage: "../../Content/images/calendar.gif",
                buttonImageOnly: true
            });
            $('#Telephone').mask("(999) 999-9999");
            $('#Celphone').mask("(999) 999-9999");
            $('#IdentificationNumber').mask("999-9999999-9");
        });
    </script>
    <% Html.EnableClientValidation();%>
</asp:Content>

